@zonos/elements 1.3.88 → 1.3.89
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{cart-120d68f9.js → cart-e15290ab.js} +15 -7
- package/dist/cjs/{createCustomEvent-ed9156dc.js → createCustomEvent-3da45800.js} +1 -1
- package/dist/cjs/index.cjs.js +7 -7
- package/dist/cjs/{paypal-875cfaf1.js → paypal-47b71e3b.js} +1 -1
- package/dist/cjs/zonos-address_7.cjs.entry.js +8 -6
- package/dist/cjs/zonos-cart-items_12.cjs.entry.js +3 -3
- package/dist/cjs/zonos-checkout.cjs.entry.js +4 -6
- package/dist/cjs/zonos-controller.cjs.entry.js +1 -1
- package/dist/cjs/zonos-country-flag.cjs.entry.js +1 -1
- package/dist/cjs/zonos-country-select_4.cjs.entry.js +1 -1
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +1 -1
- package/dist/cjs/zonos-hello.cjs.entry.js +1 -1
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +1 -1
- package/dist/cjs/zonos-notification_3.cjs.entry.js +2 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +2 -4
- package/dist/collection/components/store/checkout/stripe.js +2 -3
- package/dist/collection/components/store/hello/localization.js +13 -4
- package/dist/collection/components/stripe/zonos-address/zonos-address.js +9 -6
- package/dist/esm/{cart-9f1caabf.js → cart-08c2a740.js} +15 -7
- package/dist/esm/{createCustomEvent-464c49c0.js → createCustomEvent-a8a9fe09.js} +1 -1
- package/dist/esm/index.js +7 -7
- package/dist/esm/{paypal-fb449438.js → paypal-4a21792c.js} +1 -1
- package/dist/esm/zonos-address_7.entry.js +9 -7
- package/dist/esm/zonos-cart-items_12.entry.js +3 -3
- package/dist/esm/zonos-checkout.entry.js +4 -6
- package/dist/esm/zonos-controller.entry.js +1 -1
- package/dist/esm/zonos-country-flag.entry.js +1 -1
- package/dist/esm/zonos-country-select_4.entry.js +1 -1
- package/dist/esm/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm/zonos-hello.entry.js +1 -1
- package/dist/esm/zonos-language-select_2.entry.js +1 -1
- package/dist/esm/zonos-notification_3.entry.js +2 -2
- package/dist/esm-es5/{cart-9f1caabf.js → cart-08c2a740.js} +1 -1
- package/dist/esm-es5/{createCustomEvent-464c49c0.js → createCustomEvent-a8a9fe09.js} +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{paypal-fb449438.js → paypal-4a21792c.js} +1 -1
- package/dist/esm-es5/zonos-address_7.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_12.entry.js +1 -1
- package/dist/esm-es5/zonos-checkout.entry.js +1 -1
- package/dist/esm-es5/zonos-controller.entry.js +1 -1
- package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
- package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
- package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm-es5/zonos-hello.entry.js +1 -1
- package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
- package/dist/esm-es5/zonos-notification_3.entry.js +1 -1
- package/dist/scripts/index.js +1 -1
- package/dist/scripts/loadZonos.js +1 -1
- package/dist/scripts/zonos.js +1 -1
- package/dist/types/components/store/hello/localization.d.ts +1 -4
- package/dist/zonos-elements/assets/RemoveIcon.svg +1 -1
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/p-0033c20b.system.entry.js +1 -0
- package/dist/zonos-elements/{p-a7127b28.system.js → p-00706ef7.system.js} +1 -1
- package/dist/zonos-elements/{p-d7cf2a25.system.js → p-05b75d37.system.js} +1 -1
- package/dist/zonos-elements/{p-3d521899.system.entry.js → p-12f25739.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-9f36076f.entry.js → p-2aeb1f26.entry.js} +1 -1
- package/dist/zonos-elements/{p-cb9ff4df.js → p-3214b2df.js} +1 -1
- package/dist/zonos-elements/{p-7fce2a19.entry.js → p-3951ac01.entry.js} +1 -1
- package/dist/zonos-elements/{p-e6129027.entry.js → p-3ac3a8be.entry.js} +1 -1
- package/dist/zonos-elements/p-48b151ae.entry.js +1 -0
- package/dist/zonos-elements/{p-5bef550e.system.entry.js → p-49010cea.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-35577bd8.system.entry.js → p-4a417566.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-72513d54.entry.js → p-4f13a851.entry.js} +1 -1
- package/dist/zonos-elements/{p-d33a87fc.entry.js → p-531973ca.entry.js} +1 -1
- package/dist/zonos-elements/{p-294026a0.system.js → p-5f0c4397.system.js} +1 -1
- package/dist/zonos-elements/{p-92f1cf70.entry.js → p-6d5d31ac.entry.js} +1 -1
- package/dist/zonos-elements/{p-0b01b9b1.system.entry.js → p-76015899.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-f7ec6999.js → p-7c8ad901.js} +1 -1
- package/dist/zonos-elements/p-8bbe007f.system.entry.js +1 -0
- package/dist/zonos-elements/p-9773abc9.entry.js +1 -0
- package/dist/zonos-elements/{p-253cbdae.entry.js → p-aab5ccde.entry.js} +1 -1
- package/dist/zonos-elements/{p-6c380fa8.system.js → p-c1f0aeb4.system.js} +1 -1
- package/dist/zonos-elements/{p-a6e99041.system.entry.js → p-c28824a0.system.entry.js} +1 -1
- package/dist/zonos-elements/p-c78dd680.system.js +1 -1
- package/dist/zonos-elements/{p-d81f35bf.js → p-db4c833d.js} +2 -2
- package/dist/zonos-elements/{p-c0a7750c.system.entry.js → p-dbd51a62.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-40299035.entry.js → p-f49ca64f.entry.js} +1 -1
- package/dist/zonos-elements/{p-69bb9b53.system.entry.js → p-f5e29ed6.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-94589f18.system.entry.js → p-fc2191b7.system.entry.js} +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +2 -3
- package/dist/zonos-elements/p-49a3a2a5.system.entry.js +0 -1
- package/dist/zonos-elements/p-a7b6fd9c.entry.js +0 -1
- package/dist/zonos-elements/p-b58f4433.entry.js +0 -1
- package/dist/zonos-elements/p-e05eed8e.system.entry.js +0 -1
|
@@ -8399,10 +8399,6 @@ const setZCountryUrlParam = (selectedCountryCode) => {
|
|
|
8399
8399
|
}
|
|
8400
8400
|
};
|
|
8401
8401
|
|
|
8402
|
-
/**
|
|
8403
|
-
* CHORE: This is mostly for legacy checkout as the country param is not guaranteed.
|
|
8404
|
-
*/
|
|
8405
|
-
const DEFAULT_COUNTRY_CODE_LEGACY_CHECKOUT = 'CA';
|
|
8406
8402
|
const { dispose: localizationDispose, onChange: localizationStoreOnUpdate, state: localizationStore, } = zonosStore.createStore({
|
|
8407
8403
|
countryLandedCost: null,
|
|
8408
8404
|
customMessages: [],
|
|
@@ -8430,6 +8426,18 @@ const triggerGetExchangeRate = async (isGuaranteed) => {
|
|
|
8430
8426
|
}
|
|
8431
8427
|
return { maxAge };
|
|
8432
8428
|
};
|
|
8429
|
+
/**
|
|
8430
|
+
* CHORE: This is mostly for legacy checkout as the country param is not guaranteed.
|
|
8431
|
+
*/
|
|
8432
|
+
const DEFAULT_COUNTRY_CODE_LEGACY_CHECKOUT = 'CA';
|
|
8433
|
+
const getFallbackDefaultCountryCode = (allowedCountries) => {
|
|
8434
|
+
if (localizationStore.selectedCountryCode &&
|
|
8435
|
+
allowedCountries.includes(localizationStore.selectedCountryCode)) {
|
|
8436
|
+
return localizationStore.selectedCountryCode;
|
|
8437
|
+
}
|
|
8438
|
+
// Don't check if it is allowed. If it is not allowed it will fallback to Albania (first option).
|
|
8439
|
+
return DEFAULT_COUNTRY_CODE_LEGACY_CHECKOUT;
|
|
8440
|
+
};
|
|
8433
8441
|
// This recursive function is for users who step away from their computer and come back needing a new exchange rate
|
|
8434
8442
|
const startExchangeRateTimeout = ({ isGuaranteed, maxAge, }) => {
|
|
8435
8443
|
if (localizationStore.exchangeRateTimeout) {
|
|
@@ -8578,6 +8586,7 @@ const initLocalizationStore = async () => {
|
|
|
8578
8586
|
// Initialize the country list for the hello widget
|
|
8579
8587
|
initHelloCountryList(allCountries || {});
|
|
8580
8588
|
const { country, locale } = localization;
|
|
8589
|
+
handleFetch.log(`Country code from localization: ${country}`);
|
|
8581
8590
|
// update selected country code in store
|
|
8582
8591
|
localizationStoreUpdateSelectedCountryCode(country);
|
|
8583
8592
|
// use locale from params if it exists, otherwise use locale from localization
|
|
@@ -9477,8 +9486,7 @@ const stripeStoreInitCheckoutSession = async () => {
|
|
|
9477
9486
|
currency: ((_a = cartStore.items.find(Boolean)) === null || _a === void 0 ? void 0 : _a.currencyCode) || '',
|
|
9478
9487
|
itemsAmount: total,
|
|
9479
9488
|
metadata: [{ key: 'language', value: localizationStore.selectedLocale }],
|
|
9480
|
-
presentmentCountryCode: localizationStore.selectedCountryCode
|
|
9481
|
-
DEFAULT_COUNTRY_CODE_LEGACY_CHECKOUT,
|
|
9489
|
+
presentmentCountryCode: localizationStore.selectedCountryCode,
|
|
9482
9490
|
},
|
|
9483
9491
|
method: 'POST',
|
|
9484
9492
|
});
|
|
@@ -10017,7 +10025,6 @@ const cartStoreResetTabItems = () => {
|
|
|
10017
10025
|
cartStoreResetSelectedShippingOption();
|
|
10018
10026
|
};
|
|
10019
10027
|
|
|
10020
|
-
exports.DEFAULT_COUNTRY_CODE_LEGACY_CHECKOUT = DEFAULT_COUNTRY_CODE_LEGACY_CHECKOUT;
|
|
10021
10028
|
exports.cartStore = cartStore;
|
|
10022
10029
|
exports.cartStoreClearCheckoutInterval = cartStoreClearCheckoutInterval;
|
|
10023
10030
|
exports.cartStoreGetShippingTransitInfo = cartStoreGetShippingTransitInfo;
|
|
@@ -10034,6 +10041,7 @@ exports.currencyConvert = currencyConvert;
|
|
|
10034
10041
|
exports.currencyConvertAndFormat = currencyConvertAndFormat;
|
|
10035
10042
|
exports.currencyDisplay = currencyDisplay;
|
|
10036
10043
|
exports.currencyFormat = currencyFormat;
|
|
10044
|
+
exports.getFallbackDefaultCountryCode = getFallbackDefaultCountryCode;
|
|
10037
10045
|
exports.getZCountryUrlParam = getZCountryUrlParam;
|
|
10038
10046
|
exports.initLocalizationStore = initLocalizationStore;
|
|
10039
10047
|
exports.initStripeElements = initStripeElements;
|
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -97,7 +97,7 @@ const getZonosQaUrl = () => {
|
|
|
97
97
|
return null;
|
|
98
98
|
}
|
|
99
99
|
const qaUrl = extractZonosQaUrl(window.location.href);
|
|
100
|
-
const cdnUrl = "https://v1.3.
|
|
100
|
+
const cdnUrl = "https://v1.3.89.js.zonos.com";
|
|
101
101
|
// when the qaUrl is not set and the built URL is from the test domain, use the test domain for testing
|
|
102
102
|
if (!qaUrl &&
|
|
103
103
|
(cdnUrl.includes('test.') ||
|
|
@@ -281,10 +281,10 @@ const zonosLoadUrl = (() => {
|
|
|
281
281
|
}
|
|
282
282
|
return null;
|
|
283
283
|
})();
|
|
284
|
-
const ZONOS_URL = "https://v1.3.
|
|
285
|
-
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.
|
|
286
|
-
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.
|
|
287
|
-
const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.
|
|
284
|
+
const ZONOS_URL = "https://v1.3.89.js.zonos.com";
|
|
285
|
+
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.89";
|
|
286
|
+
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.89";
|
|
287
|
+
const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.89";
|
|
288
288
|
const INTER_FONT_URL = 'https://rsms.me';
|
|
289
289
|
const GOOGLE_FONT_URL = 'https://fonts.googleapis.com';
|
|
290
290
|
const INTER_FONT_REGEX = /^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;
|
|
@@ -299,7 +299,7 @@ Zonos.zonosConversionTest = typeof window !== 'undefined' &&
|
|
|
299
299
|
!!window.location.search.match(/\?.*(&*)zonosConversionTest/);
|
|
300
300
|
Zonos._paypalMockResponse = null;
|
|
301
301
|
Zonos.isBigCommerce = false;
|
|
302
|
-
Zonos.releaseDate = "
|
|
302
|
+
Zonos.releaseDate = "1728924518080";
|
|
303
303
|
Zonos.isLegacyCheckout = false;
|
|
304
304
|
/**
|
|
305
305
|
* By default, the package will load from npm
|
|
@@ -307,7 +307,7 @@ Zonos.isLegacyCheckout = false;
|
|
|
307
307
|
Zonos.isNpm = true;
|
|
308
308
|
Zonos.zonosQaUrl = null;
|
|
309
309
|
Zonos.zonosQaUrlApi = null;
|
|
310
|
-
Zonos.version = `v${"1.3.
|
|
310
|
+
Zonos.version = `v${"1.3.89"}`;
|
|
311
311
|
Zonos.modeAlerted = false;
|
|
312
312
|
Zonos.cartData = null;
|
|
313
313
|
Zonos.paypal = null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const zonosStore = require('./zonosStore-a4395972.js');
|
|
4
|
-
const cart = require('./cart-
|
|
4
|
+
const cart = require('./cart-e15290ab.js');
|
|
5
5
|
const handleFetch = require('./handleFetch-45e76490.js');
|
|
6
6
|
const isDarkColor = require('./isDarkColor-5efc8367.js');
|
|
7
7
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-d56e0a8b.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-e15290ab.js');
|
|
7
7
|
const isCheckoutMobile = require('./isCheckoutMobile-f491ca7c.js');
|
|
8
8
|
const handleFetch = require('./handleFetch-45e76490.js');
|
|
9
9
|
const containsNonLatinChars = require('./containsNonLatinChars-2be5129b.js');
|
|
@@ -75,16 +75,18 @@ const ZonosAddress = class {
|
|
|
75
75
|
const shippingZone = shippableCountries
|
|
76
76
|
? Object.values(shippableCountries).map(country => country.code)
|
|
77
77
|
: [];
|
|
78
|
+
const allowedCountries = this.type === 'shipping' ? shippingZone : [];
|
|
79
|
+
const defaultAddressCountry = (stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.country) ||
|
|
80
|
+
cart.getFallbackDefaultCountryCode(allowedCountries);
|
|
81
|
+
handleFetch.log(`Stripe country code: ${defaultAddressCountry}`, 'info');
|
|
78
82
|
const addressElement = stripeElements.create('address', {
|
|
79
|
-
allowedCountries
|
|
83
|
+
allowedCountries,
|
|
80
84
|
// only show the default address if stripeAddressEventData is not provided
|
|
81
85
|
contacts: this.defaultAddress && !stripeAddressEventData
|
|
82
86
|
? [this.defaultAddress]
|
|
83
87
|
: [],
|
|
84
88
|
defaultValues: {
|
|
85
|
-
address: Object.assign(Object.assign({}, stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address), { country:
|
|
86
|
-
cart.localizationStore.selectedCountryCode ||
|
|
87
|
-
cart.DEFAULT_COUNTRY_CODE_LEGACY_CHECKOUT }),
|
|
89
|
+
address: Object.assign(Object.assign({}, stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address), { country: defaultAddressCountry }),
|
|
88
90
|
firstName: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.firstName,
|
|
89
91
|
lastName: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.lastName,
|
|
90
92
|
phone: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.phone,
|
|
@@ -147,7 +149,7 @@ const ZonosAddress = class {
|
|
|
147
149
|
}
|
|
148
150
|
render() {
|
|
149
151
|
// this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
|
|
150
|
-
return (index.h(index.Host, { key: '
|
|
152
|
+
return (index.h(index.Host, { key: '15074e6cf5021e2d583838eb866f92cb8dad0c1e', class: "zonos--address zonos--elements" }, index.h("zonos-text", { key: '4203a4dffc101ba0667e975ff2ebe6125e023509', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), index.h("div", { key: '66add8724cb61193252e44b7a8179fbabc34d3d2', class: "zonos--address-component" })));
|
|
151
153
|
}
|
|
152
154
|
get el() { return index.getElement(this); }
|
|
153
155
|
static get watchers() { return {
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-d56e0a8b.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-e15290ab.js');
|
|
7
7
|
const classes = require('./classes-b7918f56.js');
|
|
8
|
-
const paypal = require('./paypal-
|
|
8
|
+
const paypal = require('./paypal-47b71e3b.js');
|
|
9
9
|
const zonosStore = require('./zonosStore-a4395972.js');
|
|
10
|
-
const createCustomEvent = require('./createCustomEvent-
|
|
10
|
+
const createCustomEvent = require('./createCustomEvent-3da45800.js');
|
|
11
11
|
const getBorderRadius = require('./getBorderRadius-5a64574c.js');
|
|
12
12
|
const handleFetch = require('./handleFetch-45e76490.js');
|
|
13
13
|
const isCheckoutMobile = require('./isCheckoutMobile-f491ca7c.js');
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-d56e0a8b.js');
|
|
6
|
-
const cart = require('./cart-
|
|
7
|
-
const paypal = require('./paypal-
|
|
6
|
+
const cart = require('./cart-e15290ab.js');
|
|
7
|
+
const paypal = require('./paypal-47b71e3b.js');
|
|
8
8
|
const zonosStore = require('./zonosStore-a4395972.js');
|
|
9
|
-
const createCustomEvent = require('./createCustomEvent-
|
|
9
|
+
const createCustomEvent = require('./createCustomEvent-3da45800.js');
|
|
10
10
|
const isCheckoutMobile = require('./isCheckoutMobile-f491ca7c.js');
|
|
11
11
|
const handleFetch = require('./handleFetch-45e76490.js');
|
|
12
12
|
const classes = require('./classes-b7918f56.js');
|
|
@@ -438,9 +438,7 @@ const ZonosCheckout = class {
|
|
|
438
438
|
const legacyShippingInfo = {
|
|
439
439
|
country:
|
|
440
440
|
// fallback to selected country code if country is not provided
|
|
441
|
-
urlParams.get('country') ||
|
|
442
|
-
cart.localizationStore.selectedCountryCode ||
|
|
443
|
-
cart.DEFAULT_COUNTRY_CODE_LEGACY_CHECKOUT,
|
|
441
|
+
urlParams.get('country') || cart.localizationStore.selectedCountryCode,
|
|
444
442
|
customerAddress1: urlParams.get('customerAddress1'),
|
|
445
443
|
customerAddress2: urlParams.get('customerAddress2'),
|
|
446
444
|
customerCity: urlParams.get('customerCity'),
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-d56e0a8b.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-e15290ab.js');
|
|
7
7
|
const zonosStore = require('./zonosStore-a4395972.js');
|
|
8
8
|
const handleFetch = require('./handleFetch-45e76490.js');
|
|
9
9
|
require('./isDarkColor-5efc8367.js');
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-d56e0a8b.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-e15290ab.js');
|
|
7
7
|
const zonosStore = require('./zonosStore-a4395972.js');
|
|
8
8
|
const classes = require('./classes-b7918f56.js');
|
|
9
9
|
require('./handleFetch-45e76490.js');
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-d56e0a8b.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-e15290ab.js');
|
|
7
7
|
const zonosStore = require('./zonosStore-a4395972.js');
|
|
8
8
|
const formatStringWithLinks = require('./formatStringWithLinks-52341fc7.js');
|
|
9
9
|
const isDarkColor = require('./isDarkColor-5efc8367.js');
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-d56e0a8b.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-e15290ab.js');
|
|
7
7
|
const zonosStore = require('./zonosStore-a4395972.js');
|
|
8
8
|
const classes = require('./classes-b7918f56.js');
|
|
9
9
|
const formatStringWithLinks = require('./formatStringWithLinks-52341fc7.js');
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-d56e0a8b.js');
|
|
6
6
|
const zonosStore = require('./zonosStore-a4395972.js');
|
|
7
|
-
const cart = require('./cart-
|
|
7
|
+
const cart = require('./cart-e15290ab.js');
|
|
8
8
|
const classes = require('./classes-b7918f56.js');
|
|
9
9
|
const handleFetch = require('./handleFetch-45e76490.js');
|
|
10
10
|
const getHasMoreSpaceOnRight = require('./getHasMoreSpaceOnRight-4c94667f.js');
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-d56e0a8b.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-e15290ab.js');
|
|
7
7
|
const zonosStore = require('./zonosStore-a4395972.js');
|
|
8
8
|
const ILanguage = require('./ILanguage-98b04442.js');
|
|
9
9
|
require('./handleFetch-45e76490.js');
|
|
@@ -5,9 +5,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-d56e0a8b.js');
|
|
6
6
|
const zonosStore = require('./zonosStore-a4395972.js');
|
|
7
7
|
const classes = require('./classes-b7918f56.js');
|
|
8
|
-
const cart = require('./cart-
|
|
8
|
+
const cart = require('./cart-e15290ab.js');
|
|
9
9
|
const handleFetch = require('./handleFetch-45e76490.js');
|
|
10
|
-
const paypal = require('./paypal-
|
|
10
|
+
const paypal = require('./paypal-47b71e3b.js');
|
|
11
11
|
require('./isDarkColor-5efc8367.js');
|
|
12
12
|
require('./getBorderRadius-5a64574c.js');
|
|
13
13
|
|
|
@@ -2,7 +2,7 @@ import { Fragment, h, Host, } from "@stencil/core";
|
|
|
2
2
|
import { cartStore, cartStoreClearCheckoutInterval, cartStoreNextStep, cartStoreReset, cartStoreResetTabItems, cartStoreSetCheckoutSession, cartStoreStartCheckoutInterval, cartStoreUpdateItems, cartStoreUpdateToErrorState, } from "../../store/checkout/cart";
|
|
3
3
|
import { paypalInitScript } from "../../store/checkout/paypal";
|
|
4
4
|
import { initStripeElements, stripeStore, stripeStoreCleanupDomesticShippingSession, stripeStoreConfirmPayment, stripeStoreHandleInventoryCheck, stripeStoreInitCheckoutSession, stripeStorePrefetchLandedCost, stripeStoreReset, } from "../../store/checkout/stripe";
|
|
5
|
-
import {
|
|
5
|
+
import { localizationStore, localizationStoreOnUpdate, } from "../../store/hello/localization";
|
|
6
6
|
import { translate } from "../../store/translationStore";
|
|
7
7
|
import { getZonosStoreTheme, zonosStore, } from "../../store/zonosStore";
|
|
8
8
|
import { buildCartItemsByTempCart } from "../../utils/api/buildCartItemsByTempCart";
|
|
@@ -284,9 +284,7 @@ export class ZonosCheckout {
|
|
|
284
284
|
const legacyShippingInfo = {
|
|
285
285
|
country:
|
|
286
286
|
// fallback to selected country code if country is not provided
|
|
287
|
-
urlParams.get('country') ||
|
|
288
|
-
localizationStore.selectedCountryCode ||
|
|
289
|
-
DEFAULT_COUNTRY_CODE_LEGACY_CHECKOUT,
|
|
287
|
+
urlParams.get('country') || localizationStore.selectedCountryCode,
|
|
290
288
|
customerAddress1: urlParams.get('customerAddress1'),
|
|
291
289
|
customerAddress2: urlParams.get('customerAddress2'),
|
|
292
290
|
customerCity: urlParams.get('customerCity'),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createStore } from "@stencil/store";
|
|
2
2
|
import { cartStore, cartStoreApplySubtotals, cartStoreCheckItemRestrictions, cartStorePreviousStep, cartStoreResetCartItems, cartStoreSetCheckoutSession, cartStoreUpdateSelectedShippingOption, } from "./cart";
|
|
3
|
-
import {
|
|
3
|
+
import { localizationStore } from "../hello/localization";
|
|
4
4
|
import { translate } from "../translationStore";
|
|
5
5
|
import { zonosStore } from "../zonosStore";
|
|
6
6
|
import { calculateLandedCostNormalized } from "../../utils/api/calculateLandedCostNormaliz";
|
|
@@ -423,8 +423,7 @@ const stripeStoreInitCheckoutSession = async () => {
|
|
|
423
423
|
currency: ((_a = cartStore.items.find(Boolean)) === null || _a === void 0 ? void 0 : _a.currencyCode) || '',
|
|
424
424
|
itemsAmount: total,
|
|
425
425
|
metadata: [{ key: 'language', value: localizationStore.selectedLocale }],
|
|
426
|
-
presentmentCountryCode: localizationStore.selectedCountryCode
|
|
427
|
-
DEFAULT_COUNTRY_CODE_LEGACY_CHECKOUT,
|
|
426
|
+
presentmentCountryCode: localizationStore.selectedCountryCode,
|
|
428
427
|
},
|
|
429
428
|
method: 'POST',
|
|
430
429
|
});
|
|
@@ -15,10 +15,6 @@ import { getCurrencyCode } from "../../utils/hello/currencyConversion/getCurrenc
|
|
|
15
15
|
import { setZCountryUrlParam } from "../../utils/hello/setZCountryUrlParam";
|
|
16
16
|
import { log } from "../../utils/logging/log";
|
|
17
17
|
import { logError } from "../../utils/logging/logError";
|
|
18
|
-
/**
|
|
19
|
-
* CHORE: This is mostly for legacy checkout as the country param is not guaranteed.
|
|
20
|
-
*/
|
|
21
|
-
export const DEFAULT_COUNTRY_CODE_LEGACY_CHECKOUT = 'CA';
|
|
22
18
|
const { dispose: localizationDispose, onChange: localizationStoreOnUpdate, state: localizationStore, } = createStore({
|
|
23
19
|
countryLandedCost: null,
|
|
24
20
|
customMessages: [],
|
|
@@ -46,6 +42,18 @@ const triggerGetExchangeRate = async (isGuaranteed) => {
|
|
|
46
42
|
}
|
|
47
43
|
return { maxAge };
|
|
48
44
|
};
|
|
45
|
+
/**
|
|
46
|
+
* CHORE: This is mostly for legacy checkout as the country param is not guaranteed.
|
|
47
|
+
*/
|
|
48
|
+
const DEFAULT_COUNTRY_CODE_LEGACY_CHECKOUT = 'CA';
|
|
49
|
+
export const getFallbackDefaultCountryCode = (allowedCountries) => {
|
|
50
|
+
if (localizationStore.selectedCountryCode &&
|
|
51
|
+
allowedCountries.includes(localizationStore.selectedCountryCode)) {
|
|
52
|
+
return localizationStore.selectedCountryCode;
|
|
53
|
+
}
|
|
54
|
+
// Don't check if it is allowed. If it is not allowed it will fallback to Albania (first option).
|
|
55
|
+
return DEFAULT_COUNTRY_CODE_LEGACY_CHECKOUT;
|
|
56
|
+
};
|
|
49
57
|
// This recursive function is for users who step away from their computer and come back needing a new exchange rate
|
|
50
58
|
const startExchangeRateTimeout = ({ isGuaranteed, maxAge, }) => {
|
|
51
59
|
if (localizationStore.exchangeRateTimeout) {
|
|
@@ -194,6 +202,7 @@ const initLocalizationStore = async () => {
|
|
|
194
202
|
// Initialize the country list for the hello widget
|
|
195
203
|
initHelloCountryList(allCountries || {});
|
|
196
204
|
const { country, locale } = localization;
|
|
205
|
+
log(`Country code from localization: ${country}`);
|
|
197
206
|
// update selected country code in store
|
|
198
207
|
localizationStoreUpdateSelectedCountryCode(country);
|
|
199
208
|
// use locale from params if it exists, otherwise use locale from localization
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { h, Host, } from "@stencil/core";
|
|
2
2
|
import { stripeStore } from "../../store/checkout/stripe";
|
|
3
|
-
import {
|
|
3
|
+
import { getFallbackDefaultCountryCode, localizationStore, } from "../../store/hello/localization";
|
|
4
4
|
import { isCheckoutMobile } from "../../utils/checkout/isCheckoutMobile";
|
|
5
|
+
import { log } from "../../utils/logging/log";
|
|
5
6
|
import { logError } from "../../utils/logging/logError";
|
|
6
7
|
/**
|
|
7
8
|
* This component is a wrapper for the stripe address element that would render default style object
|
|
@@ -63,16 +64,18 @@ export class ZonosAddress {
|
|
|
63
64
|
const shippingZone = shippableCountries
|
|
64
65
|
? Object.values(shippableCountries).map(country => country.code)
|
|
65
66
|
: [];
|
|
67
|
+
const allowedCountries = this.type === 'shipping' ? shippingZone : [];
|
|
68
|
+
const defaultAddressCountry = (stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.country) ||
|
|
69
|
+
getFallbackDefaultCountryCode(allowedCountries);
|
|
70
|
+
log(`Stripe country code: ${defaultAddressCountry}`, 'info');
|
|
66
71
|
const addressElement = stripeElements.create('address', {
|
|
67
|
-
allowedCountries
|
|
72
|
+
allowedCountries,
|
|
68
73
|
// only show the default address if stripeAddressEventData is not provided
|
|
69
74
|
contacts: this.defaultAddress && !stripeAddressEventData
|
|
70
75
|
? [this.defaultAddress]
|
|
71
76
|
: [],
|
|
72
77
|
defaultValues: {
|
|
73
|
-
address: Object.assign(Object.assign({}, stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address), { country:
|
|
74
|
-
localizationStore.selectedCountryCode ||
|
|
75
|
-
DEFAULT_COUNTRY_CODE_LEGACY_CHECKOUT }),
|
|
78
|
+
address: Object.assign(Object.assign({}, stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address), { country: defaultAddressCountry }),
|
|
76
79
|
firstName: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.firstName,
|
|
77
80
|
lastName: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.lastName,
|
|
78
81
|
phone: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.phone,
|
|
@@ -135,7 +138,7 @@ export class ZonosAddress {
|
|
|
135
138
|
}
|
|
136
139
|
render() {
|
|
137
140
|
// this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
|
|
138
|
-
return (h(Host, { key: '
|
|
141
|
+
return (h(Host, { key: '15074e6cf5021e2d583838eb866f92cb8dad0c1e', class: "zonos--address zonos--elements" }, h("zonos-text", { key: '4203a4dffc101ba0667e975ff2ebe6125e023509', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), h("div", { key: '66add8724cb61193252e44b7a8179fbabc34d3d2', class: "zonos--address-component" })));
|
|
139
142
|
}
|
|
140
143
|
static get is() { return "zonos-address"; }
|
|
141
144
|
static get encapsulation() { return "scoped"; }
|
|
@@ -8397,10 +8397,6 @@ const setZCountryUrlParam = (selectedCountryCode) => {
|
|
|
8397
8397
|
}
|
|
8398
8398
|
};
|
|
8399
8399
|
|
|
8400
|
-
/**
|
|
8401
|
-
* CHORE: This is mostly for legacy checkout as the country param is not guaranteed.
|
|
8402
|
-
*/
|
|
8403
|
-
const DEFAULT_COUNTRY_CODE_LEGACY_CHECKOUT = 'CA';
|
|
8404
8400
|
const { dispose: localizationDispose, onChange: localizationStoreOnUpdate, state: localizationStore, } = createStore({
|
|
8405
8401
|
countryLandedCost: null,
|
|
8406
8402
|
customMessages: [],
|
|
@@ -8428,6 +8424,18 @@ const triggerGetExchangeRate = async (isGuaranteed) => {
|
|
|
8428
8424
|
}
|
|
8429
8425
|
return { maxAge };
|
|
8430
8426
|
};
|
|
8427
|
+
/**
|
|
8428
|
+
* CHORE: This is mostly for legacy checkout as the country param is not guaranteed.
|
|
8429
|
+
*/
|
|
8430
|
+
const DEFAULT_COUNTRY_CODE_LEGACY_CHECKOUT = 'CA';
|
|
8431
|
+
const getFallbackDefaultCountryCode = (allowedCountries) => {
|
|
8432
|
+
if (localizationStore.selectedCountryCode &&
|
|
8433
|
+
allowedCountries.includes(localizationStore.selectedCountryCode)) {
|
|
8434
|
+
return localizationStore.selectedCountryCode;
|
|
8435
|
+
}
|
|
8436
|
+
// Don't check if it is allowed. If it is not allowed it will fallback to Albania (first option).
|
|
8437
|
+
return DEFAULT_COUNTRY_CODE_LEGACY_CHECKOUT;
|
|
8438
|
+
};
|
|
8431
8439
|
// This recursive function is for users who step away from their computer and come back needing a new exchange rate
|
|
8432
8440
|
const startExchangeRateTimeout = ({ isGuaranteed, maxAge, }) => {
|
|
8433
8441
|
if (localizationStore.exchangeRateTimeout) {
|
|
@@ -8576,6 +8584,7 @@ const initLocalizationStore = async () => {
|
|
|
8576
8584
|
// Initialize the country list for the hello widget
|
|
8577
8585
|
initHelloCountryList(allCountries || {});
|
|
8578
8586
|
const { country, locale } = localization;
|
|
8587
|
+
log(`Country code from localization: ${country}`);
|
|
8579
8588
|
// update selected country code in store
|
|
8580
8589
|
localizationStoreUpdateSelectedCountryCode(country);
|
|
8581
8590
|
// use locale from params if it exists, otherwise use locale from localization
|
|
@@ -9475,8 +9484,7 @@ const stripeStoreInitCheckoutSession = async () => {
|
|
|
9475
9484
|
currency: ((_a = cartStore.items.find(Boolean)) === null || _a === void 0 ? void 0 : _a.currencyCode) || '',
|
|
9476
9485
|
itemsAmount: total,
|
|
9477
9486
|
metadata: [{ key: 'language', value: localizationStore.selectedLocale }],
|
|
9478
|
-
presentmentCountryCode: localizationStore.selectedCountryCode
|
|
9479
|
-
DEFAULT_COUNTRY_CODE_LEGACY_CHECKOUT,
|
|
9487
|
+
presentmentCountryCode: localizationStore.selectedCountryCode,
|
|
9480
9488
|
},
|
|
9481
9489
|
method: 'POST',
|
|
9482
9490
|
});
|
|
@@ -10015,4 +10023,4 @@ const cartStoreResetTabItems = () => {
|
|
|
10015
10023
|
cartStoreResetSelectedShippingOption();
|
|
10016
10024
|
};
|
|
10017
10025
|
|
|
10018
|
-
export { setZCountryUrlParam as A, currencyDisplay as B, currencyConvertAndFormat as C,
|
|
10026
|
+
export { setZCountryUrlParam as A, currencyDisplay as B, currencyConvertAndFormat as C, currencyConvert as D, currencyFormat as E, cartStoreHasOneEligibleItem as F, stripeStoreApplyPromoCode as G, stripeStoreRemovePromoCode as H, stripeStoreRetrievePayment as I, stripeStoreMessageBasedOnStatus as J, stripeStoreResetPromoCode as K, stripeStoreTranslateAddressToLatin as L, cartStoreUpdateSelectedShippingOption as M, cartStoreGetShippingTransitInfo as N, sortServiceLevelOptionsByAmount as O, getFallbackDefaultCountryCode as P, localizationStoreUpdateSelectedLocale as Q, localizationStoreUpdateSelectedCountryCode as a, stripeStoreCleanupDomesticShippingSession as b, stripeStoreSaveDomesticShippingSession as c, cartStore as d, cartStoreUpdateItems as e, cartStoreReset as f, cartStoreResetTabItems as g, cartStoreClearCheckoutInterval as h, initStripeElements as i, stripeStore as j, stripeStoreInitCheckoutSession as k, localizationStore as l, cartStoreStartCheckoutInterval as m, cartStoreUpdateToErrorState as n, cartStoreSetCheckoutSession as o, stripeStorePrefetchLandedCost as p, cartStoreNextStep as q, stripeStoreHandleInventoryCheck as r, stripeStoreGetDomesticShippingSession as s, translate as t, stripeStoreConfirmPayment as u, stripeStoreReset as v, localizationStoreOnUpdate as w, isValidSelector as x, initLocalizationStore as y, getZCountryUrlParam as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as cartStore, l as localizationStore } from './cart-
|
|
1
|
+
import { d as cartStore, l as localizationStore } from './cart-08c2a740.js';
|
|
2
2
|
import { z as zonosStore } from './zonosStore-0dc7a947.js';
|
|
3
3
|
import { h as handleFetch } from './handleFetch-0133265e.js';
|
|
4
4
|
|
package/dist/esm/index.js
CHANGED
|
@@ -94,7 +94,7 @@ const getZonosQaUrl = () => {
|
|
|
94
94
|
return null;
|
|
95
95
|
}
|
|
96
96
|
const qaUrl = extractZonosQaUrl(window.location.href);
|
|
97
|
-
const cdnUrl = "https://v1.3.
|
|
97
|
+
const cdnUrl = "https://v1.3.89.js.zonos.com";
|
|
98
98
|
// when the qaUrl is not set and the built URL is from the test domain, use the test domain for testing
|
|
99
99
|
if (!qaUrl &&
|
|
100
100
|
(cdnUrl.includes('test.') ||
|
|
@@ -278,10 +278,10 @@ const zonosLoadUrl = (() => {
|
|
|
278
278
|
}
|
|
279
279
|
return null;
|
|
280
280
|
})();
|
|
281
|
-
const ZONOS_URL = "https://v1.3.
|
|
282
|
-
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.
|
|
283
|
-
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.
|
|
284
|
-
const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.
|
|
281
|
+
const ZONOS_URL = "https://v1.3.89.js.zonos.com";
|
|
282
|
+
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.89";
|
|
283
|
+
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.89";
|
|
284
|
+
const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.89";
|
|
285
285
|
const INTER_FONT_URL = 'https://rsms.me';
|
|
286
286
|
const GOOGLE_FONT_URL = 'https://fonts.googleapis.com';
|
|
287
287
|
const INTER_FONT_REGEX = /^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;
|
|
@@ -296,7 +296,7 @@ Zonos.zonosConversionTest = typeof window !== 'undefined' &&
|
|
|
296
296
|
!!window.location.search.match(/\?.*(&*)zonosConversionTest/);
|
|
297
297
|
Zonos._paypalMockResponse = null;
|
|
298
298
|
Zonos.isBigCommerce = false;
|
|
299
|
-
Zonos.releaseDate = "
|
|
299
|
+
Zonos.releaseDate = "1728924518080";
|
|
300
300
|
Zonos.isLegacyCheckout = false;
|
|
301
301
|
/**
|
|
302
302
|
* By default, the package will load from npm
|
|
@@ -304,7 +304,7 @@ Zonos.isLegacyCheckout = false;
|
|
|
304
304
|
Zonos.isNpm = true;
|
|
305
305
|
Zonos.zonosQaUrl = null;
|
|
306
306
|
Zonos.zonosQaUrlApi = null;
|
|
307
|
-
Zonos.version = `v${"1.3.
|
|
307
|
+
Zonos.version = `v${"1.3.89"}`;
|
|
308
308
|
Zonos.modeAlerted = false;
|
|
309
309
|
Zonos.cartData = null;
|
|
310
310
|
Zonos.paypal = null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z as zonosStore, c as createStore } from './zonosStore-0dc7a947.js';
|
|
2
|
-
import { d as cartStore, r as stripeStoreHandleInventoryCheck, t as translate, q as cartStoreNextStep, h as cartStoreClearCheckoutInterval } from './cart-
|
|
2
|
+
import { d as cartStore, r as stripeStoreHandleInventoryCheck, t as translate, q as cartStoreNextStep, h as cartStoreClearCheckoutInterval } from './cart-08c2a740.js';
|
|
3
3
|
import { h as handleFetch, l as log, a as logError, j as jsonParse } from './handleFetch-0133265e.js';
|
|
4
4
|
import { t as tinycolor } from './isDarkColor-b3afa948.js';
|
|
5
5
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, d as getElement } from './index-86b8247e.js';
|
|
2
|
-
import { j as stripeStore,
|
|
2
|
+
import { j as stripeStore, P as getFallbackDefaultCountryCode, l as localizationStore, t as translate } from './cart-08c2a740.js';
|
|
3
3
|
import { i as isCheckoutMobile } from './isCheckoutMobile-8846dccb.js';
|
|
4
|
-
import { a as logError } from './handleFetch-0133265e.js';
|
|
4
|
+
import { a as logError, l as log } from './handleFetch-0133265e.js';
|
|
5
5
|
import { i as isTextContainsNonLatinChars, c as containsNonLatinChars } from './containsNonLatinChars-2d8810c3.js';
|
|
6
6
|
import { z as zonosStore, d as zonosStoreFontFamily } from './zonosStore-0dc7a947.js';
|
|
7
7
|
import { c as classes } from './classes-0d95c529.js';
|
|
@@ -71,16 +71,18 @@ const ZonosAddress = class {
|
|
|
71
71
|
const shippingZone = shippableCountries
|
|
72
72
|
? Object.values(shippableCountries).map(country => country.code)
|
|
73
73
|
: [];
|
|
74
|
+
const allowedCountries = this.type === 'shipping' ? shippingZone : [];
|
|
75
|
+
const defaultAddressCountry = (stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.country) ||
|
|
76
|
+
getFallbackDefaultCountryCode(allowedCountries);
|
|
77
|
+
log(`Stripe country code: ${defaultAddressCountry}`, 'info');
|
|
74
78
|
const addressElement = stripeElements.create('address', {
|
|
75
|
-
allowedCountries
|
|
79
|
+
allowedCountries,
|
|
76
80
|
// only show the default address if stripeAddressEventData is not provided
|
|
77
81
|
contacts: this.defaultAddress && !stripeAddressEventData
|
|
78
82
|
? [this.defaultAddress]
|
|
79
83
|
: [],
|
|
80
84
|
defaultValues: {
|
|
81
|
-
address: Object.assign(Object.assign({}, stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address), { country:
|
|
82
|
-
localizationStore.selectedCountryCode ||
|
|
83
|
-
DEFAULT_COUNTRY_CODE_LEGACY_CHECKOUT }),
|
|
85
|
+
address: Object.assign(Object.assign({}, stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address), { country: defaultAddressCountry }),
|
|
84
86
|
firstName: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.firstName,
|
|
85
87
|
lastName: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.lastName,
|
|
86
88
|
phone: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.phone,
|
|
@@ -143,7 +145,7 @@ const ZonosAddress = class {
|
|
|
143
145
|
}
|
|
144
146
|
render() {
|
|
145
147
|
// this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
|
|
146
|
-
return (h(Host, { key: '
|
|
148
|
+
return (h(Host, { key: '15074e6cf5021e2d583838eb866f92cb8dad0c1e', class: "zonos--address zonos--elements" }, h("zonos-text", { key: '4203a4dffc101ba0667e975ff2ebe6125e023509', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), h("div", { key: '66add8724cb61193252e44b7a8179fbabc34d3d2', class: "zonos--address-component" })));
|
|
147
149
|
}
|
|
148
150
|
get el() { return getElement(this); }
|
|
149
151
|
static get watchers() { return {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { r as registerInstance, a as getAssetPath, h, H as Host, F as Fragment, c as createEvent, d as getElement } from './index-86b8247e.js';
|
|
2
|
-
import { d as cartStore, t as translate,
|
|
2
|
+
import { d as cartStore, t as translate, E as currencyFormat, F as cartStoreHasOneEligibleItem, G as stripeStoreApplyPromoCode, H as stripeStoreRemovePromoCode, v as stripeStoreReset, j as stripeStore, I as stripeStoreRetrievePayment, J as stripeStoreMessageBasedOnStatus, K as stripeStoreResetPromoCode, l as localizationStore, L as stripeStoreTranslateAddressToLatin, M as cartStoreUpdateSelectedShippingOption, N as cartStoreGetShippingTransitInfo, O as sortServiceLevelOptionsByAmount } from './cart-08c2a740.js';
|
|
3
3
|
import { c as classes } from './classes-0d95c529.js';
|
|
4
|
-
import { s as submitGtag, a as paypalStore, b as paypalStoreReset, c as paypalStoreHasPaypalEnabled, i as isContrastColor } from './paypal-
|
|
4
|
+
import { s as submitGtag, a as paypalStore, b as paypalStoreReset, c as paypalStoreHasPaypalEnabled, i as isContrastColor } from './paypal-4a21792c.js';
|
|
5
5
|
import { z as zonosStore, g as getZonosStoreTheme, d as zonosStoreFontFamily } from './zonosStore-0dc7a947.js';
|
|
6
|
-
import { t as trackConversionEvent, c as createCustomEvent, g as getIsTestMode } from './createCustomEvent-
|
|
6
|
+
import { t as trackConversionEvent, c as createCustomEvent, g as getIsTestMode } from './createCustomEvent-a8a9fe09.js';
|
|
7
7
|
import { g as getBorderRadius } from './getBorderRadius-cff1e39b.js';
|
|
8
8
|
import { h as handleFetch, s as sendErrorLog } from './handleFetch-0133265e.js';
|
|
9
9
|
import { i as isCheckoutMobile } from './isCheckoutMobile-8846dccb.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, F as Fragment } from './index-86b8247e.js';
|
|
2
|
-
import { l as localizationStore, s as stripeStoreGetDomesticShippingSession, a as localizationStoreUpdateSelectedCountryCode, b as stripeStoreCleanupDomesticShippingSession, c as stripeStoreSaveDomesticShippingSession, i as initStripeElements, d as cartStore, e as cartStoreUpdateItems, f as cartStoreReset, g as cartStoreResetTabItems, h as cartStoreClearCheckoutInterval, j as stripeStore, k as stripeStoreInitCheckoutSession, m as cartStoreStartCheckoutInterval, n as cartStoreUpdateToErrorState, t as translate,
|
|
3
|
-
import { s as submitGtag, p as paypalInitScript } from './paypal-
|
|
2
|
+
import { l as localizationStore, s as stripeStoreGetDomesticShippingSession, a as localizationStoreUpdateSelectedCountryCode, b as stripeStoreCleanupDomesticShippingSession, c as stripeStoreSaveDomesticShippingSession, i as initStripeElements, d as cartStore, e as cartStoreUpdateItems, f as cartStoreReset, g as cartStoreResetTabItems, h as cartStoreClearCheckoutInterval, j as stripeStore, k as stripeStoreInitCheckoutSession, m as cartStoreStartCheckoutInterval, n as cartStoreUpdateToErrorState, t as translate, o as cartStoreSetCheckoutSession, p as stripeStorePrefetchLandedCost, q as cartStoreNextStep, r as stripeStoreHandleInventoryCheck, u as stripeStoreConfirmPayment, v as stripeStoreReset, w as localizationStoreOnUpdate } from './cart-08c2a740.js';
|
|
3
|
+
import { s as submitGtag, p as paypalInitScript } from './paypal-4a21792c.js';
|
|
4
4
|
import { z as zonosStore, g as getZonosStoreTheme, m as mergeConfig } from './zonosStore-0dc7a947.js';
|
|
5
|
-
import { t as trackConversionEvent, c as createCustomEvent, g as getIsTestMode } from './createCustomEvent-
|
|
5
|
+
import { t as trackConversionEvent, c as createCustomEvent, g as getIsTestMode } from './createCustomEvent-a8a9fe09.js';
|
|
6
6
|
import { i as isCheckoutMobile } from './isCheckoutMobile-8846dccb.js';
|
|
7
7
|
import { l as log, a as logError, s as sendErrorLog, b as allLogs } from './handleFetch-0133265e.js';
|
|
8
8
|
import { c as classes } from './classes-0d95c529.js';
|
|
@@ -434,9 +434,7 @@ const ZonosCheckout = class {
|
|
|
434
434
|
const legacyShippingInfo = {
|
|
435
435
|
country:
|
|
436
436
|
// fallback to selected country code if country is not provided
|
|
437
|
-
urlParams.get('country') ||
|
|
438
|
-
localizationStore.selectedCountryCode ||
|
|
439
|
-
DEFAULT_COUNTRY_CODE_LEGACY_CHECKOUT,
|
|
437
|
+
urlParams.get('country') || localizationStore.selectedCountryCode,
|
|
440
438
|
customerAddress1: urlParams.get('customerAddress1'),
|
|
441
439
|
customerAddress2: urlParams.get('customerAddress2'),
|
|
442
440
|
customerCity: urlParams.get('customerCity'),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-86b8247e.js';
|
|
2
|
-
import { x as isValidSelector, j as stripeStore, y as initLocalizationStore, d as cartStore, a as localizationStoreUpdateSelectedCountryCode } from './cart-
|
|
2
|
+
import { x as isValidSelector, j as stripeStore, y as initLocalizationStore, d as cartStore, a as localizationStoreUpdateSelectedCountryCode } from './cart-08c2a740.js';
|
|
3
3
|
import { z as zonosStore, b as zonosStoreInitSetting, d as zonosStoreFontFamily } from './zonosStore-0dc7a947.js';
|
|
4
4
|
import { h as handleFetch, a as logError, l as log } from './handleFetch-0133265e.js';
|
|
5
5
|
import './isDarkColor-b3afa948.js';
|